package com.facebook.ads.internal.a;

import android.content.Context;
import android.net.Uri;
import android.support.annotation.Nullable;
import java.util.Map;

public class c {
    private static final String a = "c";

    @Nullable
    public static b a(Context context, com.facebook.ads.internal.o.c cVar, String str, Uri uri, Map<String, String> map) {
        return a(context, cVar, str, uri, map, false);
    }

    /* JADX WARNING: Removed duplicated region for block: B:20:0x0060  */
    /* JADX WARNING: Removed duplicated region for block: B:30:0x007f  */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x008b  */
    /* JADX WARNING: Removed duplicated region for block: B:36:0x0093  */
    /* JADX WARNING: Removed duplicated region for block: B:38:0x009d  */
    /* JADX WARNING: Removed duplicated region for block: B:40:0x00a7  */
    @android.support.annotation.Nullable
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static com.facebook.ads.internal.a.b a(android.content.Context r11, com.facebook.ads.internal.o.c r12, java.lang.String r13, android.net.Uri r14, java.util.Map<java.lang.String, java.lang.String> r15, boolean r16) {
        /*
            r3 = r12
            r5 = r14
            r1 = 0
            if (r5 != 0) goto L_0x0006
            return r1
        L_0x0006:
            java.lang.String r2 = r5.getAuthority()
            java.lang.String r4 = "video_url"
            java.lang.String r4 = r5.getQueryParameter(r4)
            java.lang.String r6 = "data"
            java.lang.String r6 = r5.getQueryParameter(r6)
            boolean r6 = android.text.TextUtils.isEmpty(r6)
            if (r6 != 0) goto L_0x004d
            org.json.JSONObject r6 = new org.json.JSONObject     // Catch:{ JSONException -> 0x0042 }
            java.lang.String r7 = "data"
            java.lang.String r7 = r5.getQueryParameter(r7)     // Catch:{ JSONException -> 0x0042 }
            r6.<init>(r7)     // Catch:{ JSONException -> 0x0042 }
            java.util.Iterator r7 = r6.keys()     // Catch:{ JSONException -> 0x0042 }
        L_0x002b:
            boolean r8 = r7.hasNext()     // Catch:{ JSONException -> 0x0042 }
            if (r8 == 0) goto L_0x004d
            java.lang.Object r8 = r7.next()     // Catch:{ JSONException -> 0x0042 }
            java.lang.String r8 = (java.lang.String) r8     // Catch:{ JSONException -> 0x0042 }
            java.lang.String r9 = r6.getString(r8)     // Catch:{ JSONException -> 0x0042 }
            r10 = r15
            r10.put(r8, r9)     // Catch:{ JSONException -> 0x0040 }
            goto L_0x002b
        L_0x0040:
            r0 = move-exception
            goto L_0x0044
        L_0x0042:
            r0 = move-exception
            r10 = r15
        L_0x0044:
            r6 = r0
            java.lang.String r7 = a
            java.lang.String r8 = "Unable to parse json data in AdActionFactory."
            android.util.Log.w(r7, r8, r6)
            goto L_0x004e
        L_0x004d:
            r10 = r15
        L_0x004e:
            android.app.Activity r6 = com.facebook.ads.internal.s.a.a.a()
            com.facebook.ads.internal.a.l r7 = com.facebook.ads.internal.a.l.a(r3, r6)
            r6 = -1
            int r8 = r2.hashCode()
            r9 = -1458789996(0xffffffffa90ca194, float:-3.122639E-14)
            if (r8 == r9) goto L_0x007f
            r9 = 109770977(0x68af8e1, float:5.2275525E-35)
            if (r8 == r9) goto L_0x0075
            r9 = 1546100943(0x5c27a0cf, float:1.88732528E17)
            if (r8 == r9) goto L_0x006b
            goto L_0x0088
        L_0x006b:
            java.lang.String r8 = "open_link"
            boolean r2 = r2.equals(r8)
            if (r2 == 0) goto L_0x0088
            r6 = 1
            goto L_0x0088
        L_0x0075:
            java.lang.String r8 = "store"
            boolean r2 = r2.equals(r8)
            if (r2 == 0) goto L_0x0088
            r6 = 0
            goto L_0x0088
        L_0x007f:
            java.lang.String r8 = "passthrough"
            boolean r2 = r2.equals(r8)
            if (r2 == 0) goto L_0x0088
            r6 = 2
        L_0x0088:
            switch(r6) {
                case 0: goto L_0x00a7;
                case 1: goto L_0x009d;
                case 2: goto L_0x0093;
                default: goto L_0x008b;
            }
        L_0x008b:
            com.facebook.ads.internal.a.k r1 = new com.facebook.ads.internal.a.k
            r2 = r11
            r4 = r13
            r1.<init>(r2, r3, r4, r5)
            return r1
        L_0x0093:
            com.facebook.ads.internal.a.j r7 = new com.facebook.ads.internal.a.j
            r1 = r7
            r2 = r11
            r4 = r13
            r6 = r10
            r1.<init>(r2, r3, r4, r5, r6)
            return r7
        L_0x009d:
            com.facebook.ads.internal.a.i r8 = new com.facebook.ads.internal.a.i
            r1 = r8
            r2 = r11
            r4 = r13
            r6 = r10
            r1.<init>(r2, r3, r4, r5, r6, r7)
            return r8
        L_0x00a7:
            if (r4 == 0) goto L_0x00aa
            return r1
        L_0x00aa:
            com.facebook.ads.internal.a.f r9 = new com.facebook.ads.internal.a.f
            r1 = r9
            r2 = r11
            r4 = r13
            r6 = r10
            r8 = r16
            r1.<init>(r2, r3, r4, r5, r6, r7, r8)
            return r9
        */
        throw new UnsupportedOperationException("Method not decompiled: com.facebook.ads.internal.a.c.a(android.content.Context, com.facebook.ads.internal.o.c, java.lang.String, android.net.Uri, java.util.Map, boolean):com.facebook.ads.internal.a.b");
    }

    public static boolean a(String str) {
        return "store".equalsIgnoreCase(str) || "open_link".equalsIgnoreCase(str);
    }
}
